// router/index.ts  
import { createBrowserRouter, Navigate } from 'react-router-dom';
import App from '../App';
import Logon from '../pages/logon/Logon'
import Login from '../pages/logon/Login'
import Register from '../pages/logon/Register'

// 定义路由对象的类型  
const router = [
    {
        path: "/",
        element: <App />,
        children: [
            {
                path: "Logon",
                element: <Logon />
            },
            {
                path: "Login",
                element: <Login />
            },
            {
                path: "Register",
                element: <Register />
            },
            {
                path: "/",
                element: <Navigate to="/Logon" />
            }
        ]
    }
];

// 创建浏览器路由  
const createRouter = createBrowserRouter(router);

export default createRouter;  